package edu.biwu.service.impl;

import edu.biwu.dao.ProductDao;
import edu.biwu.po.Product;
import edu.biwu.service.ProductService;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Setter
@Service
public class ProductServiceImpl implements ProductService {
    //通过setter方法在spring中注入dao
    @Autowired
    private ProductDao productDao;

//  例如:  public void setProductDao(ProductDao productDao) {
//        this.productDao = productDao;
//    }

    @Override
    public void updateProduct(Product product) {
            productDao.updateProduct(product);
    }

    @Override
    public List<Product> findAll() {
        return productDao.findAll();
    }
}
